<template>
  <note-editor @submit="handleAddNote" />
</template>

<script>
  export default {
    methods: {
      async handleAddNote(noteData) {
        // 调用API添加笔记
        console.log('添加笔记:', noteData)
        const {
          data: res
        } = await uni.$http.post("/note", noteData)
        if (res.code !== 1) throw new Error('添加笔记失败')
      }
    }
  }
</script>
